package top.lyjwn.ajui.widget.loading;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

import com.xuexiang.xui.widget.progress.loading.ARCLoadingView;

import androidx.annotation.Nullable;
import top.lyjwn.ajui.R;

/**
 * @author luoyujie
 *
 * 加载视图
 */
public class LoadingView extends LinearLayout {

    private Context context;

    private ARCLoadingView arcLoadingView;

    public LoadingView(Context context) {
        this(context, null);
    }

    public LoadingView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        this.context = context;
        init();
    }

    private void init(){
        View v = LayoutInflater.from(context).inflate(R.layout.widget_loading_loading, this);
        arcLoadingView = v.findViewById(R.id.widget_loading_loading_loading);
    }

    public void start(){
        arcLoadingView.start();
    }

    public void stop(){
        arcLoadingView.stop();
    }
}
